<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>配置条件列</title>
    <link href="/bower_components/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="/static/css/controls.css" rel="stylesheet"/>
    <link href="/static/css/engine.css" rel="stylesheet">
    <script>
        var ctx = '';
    </script>
    <script src="../../../../bower_components/requirejs/require.js" data-main="../../../static/app.js"
            data-bootstrap-modules="'system2/decision/DedutionModule'"></script>
</head>
<body ng-cloak ng-controller="DeductionController">
<div class="engine-tab-content" data-key="conditions">
    <!--详细内容左列-->
    <div id="shadeCondition"></div>
    <div class="engine-tab-content-l" style="top: 0px">
        <!--添加-->

        <div class="bc">
            <button type="button" class="engine-btn-success" ng-click="save()"><i class="icon-engine-preservation"></i>保存</button>
        </div>
        <div class="clear"></div>
        <div class="entry" id="then">
            <div class="entry-title">
                <div class="entry-title-l">那么</div>
                <div class="add"><a href="javascript:void(0)"
                                    ng-click="addThen('setRtnValue','',true)"><i class="icon-engine-plus"></i></a></div>
                <div class="clear"></div>
            </div>
            <div class="entry-set" ng-repeat="thenRow in thenRows" name="rowT" id="removeThen{{thenRow._id}}">
                <div class="nub">{{$index+1}}</div>
                <div class="entry-set-l" name="rowVariable" id="addRow{{thenRow._id}}">
                            <span class="also">
                                <a href="javascript:void(0)" ng-if="thenRow.sign=='setRtnValue'" name="node" id  = "then{{thenRow.countCondition}}" ng-click="changeThen(thenRow.countCondition)" value="{'type':'{{thenRow.sign}}'}" type="return" >返回：<i class="icon-engine-down-a"></i></a>
                                <a href="javascript:void(0)" ng-if="thenRow.sign=='breakPackage'" name="node" id  = "then{{thenRow.countCondition}}" ng-click="changeThen(thenRow.countCondition)" value="{'type':'{{thenRow.sign}}'}"  type="break">跳出规则包。<i class="icon-engine-down-a"></i></a>
                                <a href="javascript:void(0)" ng-if="thenRow.sign=='breakAssembly'" name="node" id  = "then{{thenRow.countCondition}}" ng-click="changeThen(thenRow.countCondition)" value="{'type':'{{thenRow.sign}}'}" type="break" >跳出规则集。<i class="icon-engine-down-a"></i></a>
                                <a href="javascript:void(0)" ng-if="thenRow.sign=='setVariable'" name="node" id  = "then{{thenRow.countCondition}}" ng-click="changeThen(thenRow.countCondition)" value="{'type':'{{thenRow.sign}}'}" type="setValue" >变量赋值：<i class="icon-engine-down-a"></i></a>
                                <a href="javascript:void(0)" ng-if="thenRow.sign=='setModel'" name="node" id  = "then{{thenRow.countCondition}}" ng-click="changeThen(thenRow.countCondition)" value="{'type':'{{thenRow.sign}}'}" type="setValue" >属性赋值：<i class="icon-engine-down-a"></i></a>
                                <a href="javascript:void(0)" ng-if="thenRow.sign=='throw'" name="node" id  = "then{{thenRow.countCondition}}" ng-click="changeThen(thenRow.countCondition)" value="{'type':'{{thenRow.sign}}'}" type="throw" >抛出异常：<i class="icon-engine-down-a"></i></a>
                                <a href="javascript:void(0)" ng-if="thenRow.sign=='execute'" name="node" id  = "then{{thenRow.countCondition}}" ng-click="changeThen(thenRow.countCondition)" value="{'type':'{{thenRow.sign}}'}" type="execute" >执行：<i class="icon-engine-down-a"></i></a>
                            </span>
                    <span class='attribute' ng-repeat="then in thenRow.conditions"  id='click{{then.countCondition}}'  onmouseleave="closeEdit('node')"  onmouseenter="showEdit('node')"><a href='javascript:void(0)' name='node'  id='node{{then.countCondition}}'  ng-click="show(then.countCondition,'node',then.type)" type={{then.type}} value={{then.value}}>{{then.mes}}</a></span>
                    <span ng-if="thenRow.isButton" id='click{{thenRow.countCondition}}' ><button type='button' name ='addButton' id='showCondition{{thenRow.countCondition}}' ng-click='show(thenRow.countCondition,&apos;button&apos;)' class='engine-btn-default'>点击选择</button></span>
                </div>
                <div class="entry-set-r">
                    <span><a href ng-click="addBracket(thenRow._id)" value={{thenRow._id}}>()</a></span>
                    <span><a href  ng-click="removeRowThen($index)">&nbsp;-</a></span>
                </div>
                <div class='clear'></div>
            </div>
        </div>

        <div class="clear"></div>

    </div>
    <!--详细内容左列结束-->
    <!--详细内容右列-->
    <div class="engine-tab-content-r" style="top: 0px" id="shadeModel">
        <div ng-show="showNone">
            <div class="remind-r">
                <div class="tu"><i class="icon-engine-remind"></i></div>
                <div class="text">请单击条件选择框进行编辑。</div>
                <div class="clear"></div>
            </div>
        </div>
        <div ng-show="showAllCondition">
            <div class="engine-condition">
                <ul>
                    <li class="on" name="column" id="property"><a href='javascript:void(0)' ng-click="show('property')">模型</a></li>
                    <li name="column" id="entry"><a href='javascript:void(0)' ng-click="show('entry')">输入值</a></li>
                    <li name="column" id="sign"><a href='javascript:void(0)' ng-click="show('sign')">符号</a></li>
                    <li name="column" id="variable"><a href='javascript:void(0)' ng-click="show('variable')">变量</a></li>
                    <li name="column" id="method"><a href='javascript:void(0)' ng-click="show('method')">方法</a></li>
                    <li name="column" id="component"><a href='javascript:void(0)' ng-click="show('component')">组件</a>
                    </li>
                    <li name="column" id="list"><a href='javascript:void(0)' ng-click="show('list')">遍历</a>
                    </li>

                </ul>
            </div>
            <!--条件结束-->
            <!--属性值-->
            <div class="engine-attribute" ng-show="showProperty">
                <!--业务模型-->
                <div class="model">
                    <div class="model-l">业务模型</div>
                    <div class="model-r"><a href="#"><i class="icon-engine-search"></i></a></div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <table width="100%">
                        <tr ng-class="{'model-value':!$first}" ng-repeat="modelAttribute in modelAttributes">
                            <td ng-if="modelAttribute.dataType!='Object'">
                                <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addModel(modelAttribute.name)">{{modelAttribute.dataType}}</button></div>
                                <div class="model-value-r">{{modelAttribute.name}}</div>
                                <div class="clear"></div>
                            </td>
                            <td ng-if="modelAttribute.dataType=='Object'">
                                <div class="model-value-l"><button type="button" class="engine-btn-model" id="{{modelAttribute.id}}" ng-click="viewObject(modelAttribute.id,1)">对象[+]</button></div>
                                <div class="model-value-r">{{modelAttribute.name}}</div>
                                <div class="clear"></div>
                                <div id="son{{modelAttribute.id}}" ></div>
                            </td>
                        </tr>
                    </table>
                </div>

            </div>

            <div class="engine-attribute" ng-show="showEntry">
                <!--输入值-->
                <div class="value">
                    <div class="engine-form-group">
                        <label>输入值</label>
                        <textarea cols="47" rows="10" ng-model="textEntry"></textarea>
                    </div>
                    <button type="button" class="engine-btn-default" ng-click="addEntry()">确定</button>
                </div>
                <!--输入值结束-->
            </div>

            <div class="engine-attribute" ng-show="showMethod">
                <!--输入值-->
                <div class="model-value">
                    <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('addHours')">确定</button></div>
                    <div class="model-value-r">加 &nbsp;<input type="text" id = "addHours" style="width: 20px"/>&nbsp; 小时</div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('lastDateTime','当天最后时间')">确定</button></div>
                    <div class="model-value-r">当天最后时间</div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('nowDate','当前时间')">确定</button></div>
                    <div class="model-value-r">当天开始时间</div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('setKey','')">确定</button></div>
                    <div class="model-value-r">临时变量：<input type="text" id = "setKey" style="width: 100px"/></div>
                    <div class="clear"></div>
                </div>
                <!--输入值结束-->
            </div>


            <div class="engine-attribute" ng-show="showVariable">
                <div class="model-value">
                    <table width="100%">
                        <tr ng-repeat="variable in variables">
                            <td>
                                <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addVariable(variable.varName)">变量</button></div>
                                <div class="model-value-r">{{variable.varName}}</div>
                                <div class="clear"></div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <div class="engine-attribute" ng-show="showSign">
                <!--符号-->
                <div class="symbol">

                    <div class="symbol-tit">比较符</div>
                    <div class="symbol-but">
                        <button type="button" ng-click="addSign('<')" class="engine-btn-symbol">小于</button>
                        <button type="button" ng-click="addSign('==')" class="engine-btn-symbol">等于</button>
                        <button type="button" ng-click="addSign('>')" class="engine-btn-symbol">大于</button>
                        <button type="button" ng-click="addSign('<=')" class="engine-btn-symbol">小于等于</button>
                        <button type="button" ng-click="addSign('!=')" class="engine-btn-symbol">不等于</button>
                        <button type="button" ng-click="addSign('>=')" class="engine-btn-symbol">大于等于</button>
                    </div>
                    <div class="symbol-tit">数值运算符</div>
                    <div class="symbol-but">
                        <button type="button"  ng-click="addSign('+')" class="engine-btn-symbol">+</button>
                        <button type="button"  ng-click="addSign('-')"class="engine-btn-symbol">-</button>
                        <button type="button" ng-click="addSign('*')" class="engine-btn-symbol">*</button>
                        <button type="button"  ng-click="addSign('/')" class="engine-btn-symbol">/</button>
                    </div>
                    <div class="symbol-tit">括号</div>
                    <div class="symbol-but">
                        <button type="button" ng-click="addSign('(')" class="engine-btn-symbol">(</button>
                        <button type="button" ng-click="addSign(')')" class="engine-btn-symbol">)</button>

                    </div>
                </div>
                <!--符号结束-->
            </div>
            <!--属性值结束-->
            <div class="clear"></div>
        </div>
        <div class="engine-attribute" ng-show="showList">
            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('list')">确定
                    </button>
                </div>
                <div class="model-value-r">循环&nbsp;&nbsp;<input type="text" id="loopList" style="width: 50px" />&nbsp;
                </div>
                <div class="clear"></div>
            </div>
            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('listEnd')">确定
                    </button>
                </div>
                <div class="model-value-r">循环结束&nbsp;&nbsp;
                </div>
                <div class="clear"></div>
            </div>

            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('judge')">确定
                    </button>
                </div>
                <div class="model-value-r">判断&nbsp;&nbsp;
                </div>
                <div class="clear"></div>
            </div>
            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('judgeEnd')">确定
                    </button>
                </div>
                <div class="model-value-r">判断结束&nbsp;&nbsp;
                </div>
                <div class="clear"></div>
            </div>
            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('listValue')">确定
                    </button>
                </div>
                <div class="model-value-r">获取&nbsp;&nbsp;<input type="text" id="listValue" style="width: 50px" />&nbsp;
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <div class="engine-attribute" ng-show="showComponent">
            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('remoteService','远程服务')">
                        确定
                    </button>
                </div>
                <div class="model-value-r">远程服务</div>
                <div class="clear"></div>
            </div>
            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('JDBCService','数据库组件')">
                        确定
                    </button>
                </div>
                <div class="model-value-r">数据库组件</div>
                <div class="clear"></div>
            </div>
            <div class="model-value">
                <div class="model-value-l">
                    <button type="button" class="engine-btn-model" ng-click="addMethod('Rule','规则组件')">
                        确定
                    </button>
                </div>
                <div class="model-value-r">规则组件</div>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>


        </div>
    </div>
    <!--详细内容右列结束-->
    <div class="clear"></div>
</div>
</body>
</html>